home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -in_the_mag- / reader_requests / scilab / demos / lmitool / of.sci < prev    next >
Text File  |  1999-09-16  |  1KB  |  35 lines

  1.  function [P,Q]=of(A,B,C)
  2.  // Generated by lmitool on Thu Feb 09 11:22:01 MET 1995
  3.    
  4.    Mbound = 1e3;
  5.    abstol = 1e-10;
  6.    nu = 10;
  7.    maxiters = 100;
  8.    reltol = 1e-10;
  9.    options=[Mbound,abstol,nu,maxiters,reltol];
  10.     
  11.  ///////////DEFINE INITIAL GUESS AND PRELIMINARY CALCULATIONS BELOW
  12.  P_init=zeros(A)                                                   
  13.  Q_init=zeros(A)                                                   
  14.  NB=kernel(B');                                                    
  15.  NC=kernel(C);                                                     
  16.  I=eye(A);                                                         
  17.  /////////// 
  18.   
  19.  XLIST0=list(P_init,Q_init)
  20.  XLIST=lmisolver(XLIST0,of_eval,options)
  21.  [P,Q]=XLIST(:)
  22.   
  23.   
  24.   
  25.  /////////////////EVALUATION FUNCTION////////////////////////////
  26.   
  27.  function [LME,LMI,OBJ]=of_eval(XLIST)
  28.  [P,Q]=XLIST(:)
  29.   
  30.  /////////////////DEFINE LME, LMI and OBJ BELOW
  31.  LME=list(P-P',Q-Q')                                               
  32.  LMI= list(-NB'*(A*Q+Q*A'+Q)*NB,-NC'*(A'*P+P*A+P)*NC,[P I; I Q]);  
  33.  OBJ=trace(P+Q);                                                   
  34.                                                                    
  35.